@extends('layouts.default')  
@section('content')
<div class="box primary">        
    <header>
        <div class="icons">
            <a href="{{ URL::to('create')}}"><i class="fa fa-plus" style="color:white;"></i></a>
        </div>
        <h5>{{Lang::get('messages.vehicle_spec')}}</h5>
        <!-- .toolbar -->
        <div class="toolbar">
            <nav style="padding: 8px;">
                <a href="javascript:;" class="btn btn-default btn-xs collapse-box">
                    <i class="fa fa-minus"></i>
                </a> 
                <a href="javascript:;" class="btn btn-default btn-xs full-box">
                    <i class="fa fa-expand"></i>
                </a> 
                <a href="javascript:;" class="btn btn-danger btn-xs close-box">
                    <i class="fa fa-times"></i>
                </a> 
            </nav>
        </div><!-- /.toolbar -->
    </header>
    <div id="div-1" class="body">   
        @foreach ($values as $v) 
        {{ Form::model($v, array('route' => array('car.update', $v->id),
                        'method' => 'PUT','class'=>'form-horizontal','id'=>'form-validate')) }}
        <div class="form-group">
            {{ Form::label('id', 'ID', array('class'=>'control-label col-lg-4')) }}
            {{ Form::label('id', isset($v->id) ? $v->id : '' ,  
                    array('class'=>'control-label col-lg-4')) }}
        </div>
        <div class="form-group">
            {{ Form::label('desc', Lang::get('messages.description').'*', 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('desc', isset($v->Description) ? $v->Description : '' , array(
                                'class' => 'form-control')) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('make', Lang::get('messages.make').'*', 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('make',isset($v->Make) ? $v->Make : '', array(
                                'class' => 'form-control')) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('model', Lang::get('messages.model').'*', array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('model', isset($v->Model) ? $v->Model : '', array(
                                'class' => 'form-control')) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('license', Lang::get('messages.license').'*', array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('license', isset($v->License)?$v->License:'',  array(
                                'class' => 'form-control')) 
                }}
            </div>
        </div>           
        @foreach ($class as $c)
        <div class="form-group">
            {{ Form::label('class', Lang::get('messages.class').'*', array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::select('class',$classes, $c->id, array(
                                'class' => 'form-control'))
                }}
            </div>
        </div>
        @endforeach           
        <div class="form-group">
            {{ Form::label('milage', Lang::get('messages.milage').'*', array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::input('number', 'milage', isset($v->Milage) ? $v->Milage : '',  array(
                                'class' => 'form-control')) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('year', Lang::get('messages.year').'*', array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::selectRange('year', 1990, 2020, isset($v->year)?$v->year:'', array(
                                'class' => 'form-control')) 
                }}
            </div>
        </div>

        <div class="form-group">
            {{ Form::label('color', Lang::get('messages.color').'*', array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::select('color', $color, isset($v->Color) ? $v->Color : '', array(
                                'class' => 'form-control')) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('vin', Lang::get('messages.vin').'*', array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('vin',isset($v->vin) ? $v->vin : '', array(
                                //'readonly'=>'',
                                'class' => 'form-control')) 
                }}
            </div>
        </div>
        <div  class="form-group" >
            {{ Form::label('fuel', Lang::get('messages.engine').'*', array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6 slider" style="width: 40%; left:25px;text-align: right;"><br/>
                <div class="slider-div"></div>
                {{ Form::text('fuel',  isset($v->fuel) ? $v->fuel : '', array(
                                'style' => 'border:0; color:blue; width: 10%; font-weight:bold;',
                                'class'=>'fuel')) }}                           
            </div>                                
        </div>
        <div class="form-group">
            {{ Form::label('fueltype', Lang::get('messages.fuel_type').'*',array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::select('fueltype', array(
                                '' => '',
                                'Diesel' => Lang::get('messages.diesel'), 
                                'Petrol' => Lang::get('messages.petrol')),
                        isset($v->fueltype) ? $v->fueltype : '' , array(
                                'class' => 'form-control')) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('trans', Lang::get('messages.transmission').'*',array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::select('trans', array(
                                '' => '',
                                'Automatic' => Lang::get('messages.automatic'), 
                                'Manual' => Lang::get('messages.manual')),
                        isset($v->trans) ? $v->trans : '' , array(
                                'class' => 'form-control')) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('id', 'Status*', array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::select('status', array(
                                '' => '',
                                '1' => Lang::get('messages.active'),
                                '0' => Lang::get('messages.not_active')
                                ),isset($v->status) ? $v->status : '', array(
                                'class' => 'form-control')
                                )
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('air_condition', Lang::get('messages.air_condition').'*', array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::Radio('air_condition', '1', ($v->air_condition == '1') ? true : false) }}
                {{ Lang::get('messages.yes')}}
                {{ Form::Radio('air_condition', '0', ($v->air_condition == '0') ? true : false) }}
                {{ Lang::get('messages.no')}}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('nr_people', Lang::get('messages.nr_people').'*', array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::selectRange('nr_people', 2, 10, isset($v->nr_people)?$v->nr_people:'', array(
                                'class' => 'form-control'));
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('nr_suitcase', Lang::get('messages.nr_suitcase').'*', array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::selectRange('nr_suitcase', 1, 4, isset($v->nr_suitcase)?$v->nr_suitcase:'', array(
                                'class' => 'form-control'));
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('nr_doors', Lang::get('messages.nr_doors').'*', array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::selectRange('nr_doors', 2, 5, isset($v->nr_doors)?$v->nr_doors:'', array(
                                'class' => 'form-control'));
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('purchase_price', Lang::get('messages.purchase_price'), array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('purchase_price', isset($v->purchase_price) ? $v->purchase_price : '', array(                   
                                'class' => 'form-control',
                                'placeholder'=>Lang::get('messages.purchase_price'))) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('comment', Lang::get('messages.comment'), array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::textarea('comment', isset($v->comment) ? $v->comment : '', array(
                                 'placeholder' =>Lang::get('messages.write_comment'),
                                 'class' => 'form-control'))
                }}  
            </div>
        </div>
        <br/>
        <div id="validation-div" class="">

        </div>
        {{ Form::submit(Lang::get('messages.save_btn'), array(
                        'class' => 'btn btn-primary btn-line')) }}
        <input type="button" value="{{Lang::get('messages.cancel_btn')}}" 
               class="btn btn-danger btn-line" onClick="history.go(-1);
                       return true;">
        {{ Form::close() }}
        @endforeach
    </div>
</div>  
@stop
